package base.exa12;

public class Human3 {
    public static void main(String[] args) {
        /*这条语句的执行意味着，money，leg，height，
         action都被分配了空间*/
        Man3 man3 = new Man3();
        //这条语句的执行说明了子类可以通过继承的方法来操作没继承来的变量或隐藏的成员变量
        man3.action();
        //People里的变量money被隐藏
        System.out.println(man3.money);
    }
}

class People3{
    private int leg = 2;
    int money;
    void action(){
        leg = 5;
        money = 10;
        System.out.println("I am a man");
    }
}

class Man3 extends People3{
    int height;
    int money = 5;
}
